while True:
    pm = input("please input the number:")
    if pm == "Q":
        print("退出")
        break
    else:
        if pm.isdigit():
            pm2 = int(pm)
            if(0 < pm2 <= 50):
                print("空气质量优")
            elif(51< pm2 <= 100):
                print("空气质量良好")
            elif(101 < pm2 <= 150):
                print("空气质量轻度污染")
            elif(151 < pm2 <= 200):
                print("空气质量中度污染")
            elif(201 < pm2 <= 300):
                print("空气质量重度污染")
            else:
                print("空气质量严重污染")
        else:
            print("请输入数字,或者输入Q退出")
